package com.heima.wemedia.v1.controller;

import com.heima.common.dtos.ResponseResult;
import com.heima.model.media.dtos.WmUserLoginDto;
import com.heima.wemedia.dto.LoginResultDto;
import com.heima.wemedia.service.WmUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
public class LoginController {

    @Autowired
    private WmUserService wmUserService;

    /**
     * 自媒体用户登录
     * @param wmUserLoginDto
     * @return
     */
    @PostMapping("/in")
    public ResponseResult<LoginResultDto> login(@RequestBody WmUserLoginDto wmUserLoginDto){
        return ResponseResult.ok(wmUserService.login(wmUserLoginDto));
    }
}